<template>
    <h2>用户理财赎回明细</h2>
    <table class="table table-bordered">
        <thead>
            <tr style="background-color:cyan">
                <th>理财项目编号</th>
                <th>账户名称</th>
                <th>理财名称</th>
                <th>用户购买金额</th>
                <th>赎回金额</th>
            </tr>
        </thead>
        <tbody>
<tr v-for="data in data" :key="data.F_id">
    <td>{{data.F_id}}</td>
    <td>{{data.UL_Name}}</td>
    <td>{{data.F_name}}</td>
    <td>{{data.UF_Money}}</td>
    <td>{{data.UFR_Money}}</td>
</tr>
        </tbody>
    </table>
</template>

<script setup lang="ts">
import { useRoute } from 'vue-router';
import { ref, onMounted } from 'vue';
import axios from 'axios';

const route = useRoute();

const data=ref([{
    F_id:'',
    F_name:'',
    UFR_Money:'',
    UF_Money:'',
    UL_Name:''
}])

console.log(route.query.id);
onMounted(() => {
    loadData();
})

//加载数据
const loadData = () => {
    axios.get("https://localhost:44387/api/Finans/GetAllUserFinanRedeemInfo",{
        params:{
            F_id:route.query.id
        }
    }).then(res=>{
        console.log(res.data);
        data.value=res.data;
    }).catch(err=>{
        console.log(err);
    })
}
</script>